@isTest
private class EventHandlerTest {
    static testMethod void testMethod1() {
        

    	 Account acc = TestUtils.createAccount();
        acc.Name = '客户A';
        acc.RecordTypeId = Utils.getRecordTypeIdByDevNameAndObjName('TerminalCustomer','Account');
        //acc.Country__c = country.Id;
        insert acc; 

        Opportunity opp = TestUtils.createOpportunity();
        opp.AccountId = acc.Id;
        opp.StageCanChange__c = '意向';
        opp.StageName = '意向';
        insert opp;


        Event e = new Event();
        e.Account__c = acc.Id ; 
        e.Opportunity__c = opp.Id;
 		e.DurationInMinutes  = 60;
 		e.ActivityDateTime = System.now();
        insert e ; 

        e.ArriveTime__c = System.now();
        e.LastVisit__c = true;
        update e ;



        delete e ;

       Weekly_Plan__c wp=new Weekly_Plan__c();
        wp.Start_Date__c=Date.today();
        wp.End_Date__c=Date.today();
        insert wp;
        
        Event eve=new Event();
        eve.WhatId=acc.Id;
        eve.Subject='sub';
        eve.StartDateTime=Datetime.now();
        eve.EndDateTime=Datetime.now();
        eve.Travel_Fee__c=1;
        eve.Busness_Fee__c=1;
        eve.Week_Plan__c=wp.Id;
        insert eve;

        wp.Status__c= '已批准';
        update wp ;
        try{
            delete eve;
        }catch(Exception exc ){}
        


    }
}